package com.iaiai.cobra.common.util;

/**
 * Created with FileUtil.
 * Package: com.iaiai.cobra.common.util
 * Author: iaiai
 * Create Time: 2024/6/28 22:09
 * QQ: 176291935
 * Email: 176291935@qq.com
 * Description:
 */
public class FileUtil {

    //获取文件后缀
    public static String getFileSuffix(String filename) {
        String suffix = null;
        if ((filename != null) && (filename.length() > 0)) {
            int dot = filename.lastIndexOf('.');
            if ((dot > -1) && (dot < (filename.length() - 1))) {
                suffix = filename.substring(dot + 1);
            }
        }
        return suffix;
    }

}
